package com.cy.captcha;

import java.io.File;

/**
 * @author stx
 * @date 2018/11/5 15:01
 * @desc
 */
public class ImageUtils {

    public static String getClickWordBgPath (){

        String imagePath = "D:\\study\\git\\captcha\\images\\pic-click";
        File file = new File(imagePath);
        String[] files = file.list();
        int randomNum = RandomUtils.getRandomInt(1 , files.length);

        String path = files[randomNum];

        return imagePath+"\\" + path;
    }


    public static String getBlockPuzzleBgPath (){

        String imagePath = "D:\\study\\git\\captcha\\images\\jigsaw\\original";
        File file = new File(imagePath);
        String[] files = file.list();
        int randomNum = RandomUtils.getRandomInt(1 , files.length);

        String path = files[randomNum];

        return imagePath+"\\" + path;
    }


    public static String getBlockPuzzleJigsawPath (){

        String imagePath = "D:\\study\\git\\captcha\\images\\jigsaw\\slidingBlock";
        File file = new File(imagePath);
        String[] files = file.list();
        int randomNum = RandomUtils.getRandomInt(1 , files.length);

        String path = files[randomNum];

        return imagePath+"\\" + path;
    }


    public static void main(String[] args) {
        System.out.println(getBlockPuzzleBgPath());
    }
}
